3.786 \(\int (a+b \sec (c+d x))^3 (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\)

Optimal. Leaf size=180 \[ \frac{\left (16 a^2 b B+3 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 d}+\frac{\left (12 a^2 b C+8 a^3 B+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{b \left (6 a^2 C+20 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac{(3 a C+4 b B) \tan (c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac{C \tan (c+d x) (a+b \sec (c+d x))^3}{4 d} \]

[Out]

((8*a^3*B + 12*a*b^2*B + 12*a^2*b*C + 3*b^3*C)*ArcTanh[Sin[c + d*x]])/(8*d) + ((16*a^2*b*B + 4*b^3*B + 3*a^3*C
 + 12*a*b^2*C)*Tan[c + d*x])/(6*d) + (b*(20*a*b*B + 6*a^2*C + 9*b^2*C)*Sec[c + d*x]*Tan[c + d*x])/(24*d) + ((4
*b*B + 3*a*C)*(a + b*Sec[c + d*x])^2*Tan[c + d*x])/(12*d) + (C*(a + b*Sec[c + d*x])^3*Tan[c + d*x])/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.26204, antiderivative size = 180, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.156, Rules used = {4056, 4048, 3770, 3767, 8} \[ \frac{\left (16 a^2 b B+3 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 d}+\frac{\left (12 a^2 b C+8 a^3 B+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{b \left (6 a^2 C+20 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac{(3 a C+4 b B) \tan (c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac{C \tan (c+d x) (a+b \sec (c+d x))^3}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[c + d*x])^3*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

((8*a^3*B + 12*a*b^2*B + 12*a^2*b*C + 3*b^3*C)*ArcTanh[Sin[c + d*x]])/(8*d) + ((16*a^2*b*B + 4*b^3*B + 3*a^3*C
 + 12*a*b^2*C)*Tan[c + d*x])/(6*d) + (b*(20*a*b*B + 6*a^2*C + 9*b^2*C)*Sec[c + d*x]*Tan[c + d*x])/(24*d) + ((4
*b*B + 3*a*C)*(a + b*Sec[c + d*x])^2*Tan[c + d*x])/(12*d) + (C*(a + b*Sec[c + d*x])^3*Tan[c + d*x])/(4*d)

Rule 4056

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_))^(m_.), x_Symbol] :> -Simp[(C*Cot[e + f*x]*(a + b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(m + 1), Int
[(a + b*Csc[e + f*x])^(m - 1)*Simp[a*A*(m + 1) + ((A*b + a*B)*(m + 1) + b*C*m)*Csc[e + f*x] + (b*B*(m + 1) + a
*C*m)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0] && IGtQ[2*m, 0]

Rule 4048

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_)), x_Symbol] :> -Simp[(b*C*Csc[e + f*x]*Cot[e + f*x])/(2*f), x] + Dist[1/2, Int[Simp[2*A*a + (2*B*a + b*(
2*A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac{1}{4} \int (a+b \sec (c+d x))^2 \left ((4 a B+3 b C) \sec (c+d x)+(4 b B+3 a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac{(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac{1}{12} \int (a+b \sec (c+d x)) \left (\left (12 a^2 B+8 b^2 B+15 a b C\right ) \sec (c+d x)+\left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac{b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac{1}{24} \int \left (3 \left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \sec (c+d x)+4 \left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac{b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac{1}{6} \left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \int \sec ^2(c+d x) \, dx+\frac{1}{8} \left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \int \sec (c+d x) \, dx\\ &=\frac{\left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac{\left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 d}\\ &=\frac{\left (8 a^3 B+12 a b^2 B+12 a^2 b C+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (16 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \tan (c+d x)}{6 d}+\frac{b \left (20 a b B+6 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B+3 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.828366, size = 140, normalized size = 0.78 \[ \frac{3 \left (12 a^2 b C+8 a^3 B+12 a b^2 B+3 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (9 b \left (4 a^2 C+4 a b B+b^2 C\right ) \sec (c+d x)+24 \left (3 a^2 b B+a^3 C+3 a b^2 C+b^3 B\right )+8 b^2 (3 a C+b B) \tan ^2(c+d x)+6 b^3 C \sec ^3(c+d x)\right )}{24 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[c + d*x])^3*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(3*(8*a^3*B + 12*a*b^2*B + 12*a^2*b*C + 3*b^3*C)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(24*(3*a^2*b*B + b^3*B +
 a^3*C + 3*a*b^2*C) + 9*b*(4*a*b*B + 4*a^2*C + b^2*C)*Sec[c + d*x] + 6*b^3*C*Sec[c + d*x]^3 + 8*b^2*(b*B + 3*a
*C)*Tan[c + d*x]^2))/(24*d)

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 290, normalized size = 1.6 \begin{align*}{\frac{B{a}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{3}C\tan \left ( dx+c \right ) }{d}}+3\,{\frac{B{a}^{2}b\tan \left ( dx+c \right ) }{d}}+{\frac{3\,{a}^{2}bC\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{3\,{a}^{2}bC\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{3\,Ba{b}^{2}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{3\,Ba{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+2\,{\frac{Ca{b}^{2}\tan \left ( dx+c \right ) }{d}}+{\frac{Ca{b}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{2\,B{b}^{3}\tan \left ( dx+c \right ) }{3\,d}}+{\frac{B{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}}+{\frac{C{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{3\,C{b}^{3}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{3\,C{b}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x)

[Out]

1/d*B*a^3*ln(sec(d*x+c)+tan(d*x+c))+a^3*C*tan(d*x+c)/d+3/d*B*a^2*b*tan(d*x+c)+3/2/d*a^2*b*C*sec(d*x+c)*tan(d*x
+c)+3/2/d*a^2*b*C*ln(sec(d*x+c)+tan(d*x+c))+3/2/d*B*a*b^2*sec(d*x+c)*tan(d*x+c)+3/2/d*B*a*b^2*ln(sec(d*x+c)+ta
n(d*x+c))+2/d*C*a*b^2*tan(d*x+c)+1/d*C*a*b^2*tan(d*x+c)*sec(d*x+c)^2+2/3/d*B*b^3*tan(d*x+c)+1/3/d*B*b^3*tan(d*
x+c)*sec(d*x+c)^2+1/4/d*C*b^3*tan(d*x+c)*sec(d*x+c)^3+3/8/d*C*b^3*sec(d*x+c)*tan(d*x+c)+3/8/d*C*b^3*ln(sec(d*x
+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.987448, size = 359, normalized size = 1.99 \begin{align*} \frac{48 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b^{2} + 16 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b^{3} - 3 \, C b^{3}{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, C a^{2} b{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, B a b^{2}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, B a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 48 \, C a^{3} \tan \left (d x + c\right ) + 144 \, B a^{2} b \tan \left (d x + c\right )}{48 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/48*(48*(tan(d*x + c)^3 + 3*tan(d*x + c))*C*a*b^2 + 16*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*b^3 - 3*C*b^3*(2*(
3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(s
in(d*x + c) - 1)) - 36*C*a^2*b*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c)
 - 1)) - 36*B*a*b^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 48
*B*a^3*log(sec(d*x + c) + tan(d*x + c)) + 48*C*a^3*tan(d*x + c) + 144*B*a^2*b*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.543402, size = 510, normalized size = 2.83 \begin{align*} \frac{3 \,{\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (8 \, B a^{3} + 12 \, C a^{2} b + 12 \, B a b^{2} + 3 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (6 \, C b^{3} + 8 \,{\left (3 \, C a^{3} + 9 \, B a^{2} b + 6 \, C a b^{2} + 2 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} + 9 \,{\left (4 \, C a^{2} b + 4 \, B a b^{2} + C b^{3}\right )} \cos \left (d x + c\right )^{2} + 8 \,{\left (3 \, C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/48*(3*(8*B*a^3 + 12*C*a^2*b + 12*B*a*b^2 + 3*C*b^3)*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 3*(8*B*a^3 + 12*C
*a^2*b + 12*B*a*b^2 + 3*C*b^3)*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(6*C*b^3 + 8*(3*C*a^3 + 9*B*a^2*b + 6
*C*a*b^2 + 2*B*b^3)*cos(d*x + c)^3 + 9*(4*C*a^2*b + 4*B*a*b^2 + C*b^3)*cos(d*x + c)^2 + 8*(3*C*a*b^2 + B*b^3)*
cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^4)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (B + C \sec{\left (c + d x \right )}\right ) \left (a + b \sec{\left (c + d x \right )}\right )^{3} \sec{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))**3*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((B + C*sec(c + d*x))*(a + b*sec(c + d*x))**3*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.26039, size = 791, normalized size = 4.39 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/24*(3*(8*B*a^3 + 12*C*a^2*b + 12*B*a*b^2 + 3*C*b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(8*B*a^3 + 12*C*a
^2*b + 12*B*a*b^2 + 3*C*b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(24*C*a^3*tan(1/2*d*x + 1/2*c)^7 + 72*B*a^
2*b*tan(1/2*d*x + 1/2*c)^7 - 36*C*a^2*b*tan(1/2*d*x + 1/2*c)^7 - 36*B*a*b^2*tan(1/2*d*x + 1/2*c)^7 + 72*C*a*b^
2*tan(1/2*d*x + 1/2*c)^7 + 24*B*b^3*tan(1/2*d*x + 1/2*c)^7 - 15*C*b^3*tan(1/2*d*x + 1/2*c)^7 - 72*C*a^3*tan(1/
2*d*x + 1/2*c)^5 - 216*B*a^2*b*tan(1/2*d*x + 1/2*c)^5 + 36*C*a^2*b*tan(1/2*d*x + 1/2*c)^5 + 36*B*a*b^2*tan(1/2
*d*x + 1/2*c)^5 - 120*C*a*b^2*tan(1/2*d*x + 1/2*c)^5 - 40*B*b^3*tan(1/2*d*x + 1/2*c)^5 - 9*C*b^3*tan(1/2*d*x +
 1/2*c)^5 + 72*C*a^3*tan(1/2*d*x + 1/2*c)^3 + 216*B*a^2*b*tan(1/2*d*x + 1/2*c)^3 + 36*C*a^2*b*tan(1/2*d*x + 1/
2*c)^3 + 36*B*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 120*C*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 40*B*b^3*tan(1/2*d*x + 1/2*c
)^3 - 9*C*b^3*tan(1/2*d*x + 1/2*c)^3 - 24*C*a^3*tan(1/2*d*x + 1/2*c) - 72*B*a^2*b*tan(1/2*d*x + 1/2*c) - 36*C*
a^2*b*tan(1/2*d*x + 1/2*c) - 36*B*a*b^2*tan(1/2*d*x + 1/2*c) - 72*C*a*b^2*tan(1/2*d*x + 1/2*c) - 24*B*b^3*tan(
1/2*d*x + 1/2*c) - 15*C*b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d